package com.subframe7536.sa.controller;

import com.subframe7536.sa.Aspect.Log;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.example.service.UserService;
import org.example.service.VO.User;
import org.example.service.base.ResponseResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户 控制类
 * </p>
 *
 * @author subframe7536
 */
@Slf4j
@RestController
@RequestMapping("/api/user")
public class UserController {

    @DubboReference
    public UserService userService;

    @Log(title = "getInfo")
    @GetMapping("/info")
    public ResponseResult<User> getInfo(@RequestHeader("token") String token) {
        return ResponseResult.ok(userService.getInfo(token));
    }

}
